<?php
    session_start();
    $queryid = isset($_GET["Id"])?$_GET["Id"]:null;
    //error_reporting(0);
    $sql = "select * from `article` ";


    if($queryid){
        $sql= $sql . " WHERE Id like ('%$queryId%') ";
    }


    $conn = new mysqli("localhost","root","","mybolg");
    $rows = [];
    $rs = $conn->query($sql);
    while($row = $rs->fetch_assoc())
        $rows[] = $row;
    $rs -> close();
    //////////////////////////////////////////////////////////////////////
    $queryid1 = isset($_GET["Id1"])?$_GET["Id1"]:null;
    //error_reporting(0);
    $sql1 = "select * from `article1` ";


    if($queryid1){
        $sql1= $sql1 . " WHERE Id1 like ('%$queryId1%') ";
    }


    $conn1 = new mysqli("localhost","root","","mybolg");
    $rows1 = [];
    $rs1 = $conn1->query($sql1);
    while($row1 = $rs1->fetch_assoc())
        $rows1[] = $row1;
    $rs1 -> close();
    //////////////////////////////////////////////////////////////////////
    $queryid2 = isset($_GET["Id2"])?$_GET["Id2"]:null;
    //error_reporting(0);
    $sql2 = "select * from `article2` ";


    if($queryid2){
        $sql2= $sql2 . " WHERE Id2 like ('%$queryId2%') ";
    }


    $conn2 = new mysqli("localhost","root","","mybolg");
    $rows2 = [];
    $rs2 = $conn2->query($sql2);
    while($row2 = $rs2->fetch_assoc())
        $rows2[] = $row2;
    $rs2 -> close();

?>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="content-type" content="text/html"charset="utf-8">
        <link type="text/css" rel="stylesheet" href="news.css"/>
        <!--<script type="text/javascript" src="js/flaotwin.js"></script>-->
        <title>XXXX新闻首页网</title>        
        <script src="flaotwin.js"></script>
    </head>
    <body>        
        <div id="layout" class="layout">
            <div id="header" class="container">
                <div id="caption-info" class="container">
                    <h1 class="col-4">XXXX新闻网</h1>
                    <div class="container">
                        <form action=""  class="parent">
                            <input type="text" class="search" placeholder="搜索">
                            <input type="button" name="" id="" class="btn">
                        </form>
                    </div>
                    <div id="user-info" class="col-3">
                            <h1>访客
                            <a class="login" href="login.html">登录</a>
                            </h1>
                    </div>
                </div>
                <div id="main-menu">
                    <ul class="topMenu">
                        <li><a>要闻</a></li>
                        <li><a>抗肺炎</a></li>
                        <li><a>北京</a></li>
                        <li><a>娱乐</a></li>
                        <li><a>体育</a></li>
                        <li><a href="wangye_2.html">军事</a></li>
                        <li><a>nba</a></li>
                        <li><a>国际</a></li>
                        <li><a href="cars.html">汽车</a></li>
                        <li id="manage">
                            <a>更多∨</a>
                            <ul>
                                <li id="user"><a>独家</a></li>
                                <li id="user"><a>热剧</a></li>
                                <li id="user"><a>抗肺炎</a></li>
                                <li id="user"><a>历史</a></li>
                                <li id="user"><a>英超</a></li>
                                <li id="user"><a>cba</a></li>
                                <li id="user"><a>明星</a></li>
                                <li id="user"><a>理财</a></li>
                                <li id="user"><a>5G</a></li>
                                <li id="user"><a>健康</a></li>
                            

                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
            <div id="">
                <div id="panel" class="list">
                    
                    <!--第一个盒子box分块-->
                    <div class="box1">
                        <div class="box1-titlePhoto">
                            <img src="tx.png" alt="腾讯图片">
                        </div>
                        <div class="box1-titleinfo">
                            <a class="txt">娱乐</a>
                            <a class="a">电视剧</a>
                            <a class="a">电影</a>
                            <a class="a">音乐</a>
                        </div>
                        
                        <div class="box1-pt1" method="GET">
                                <img src="yellowpicture.jpg" alt="黄图">
                                <?php foreach($rows as $row){?>
                                    <p><a href="xiangqing.php?Id=<?=$row["Id"]?>"><?=$row["Title"]?></a></p>
                                <?php } ?><a href="xiangqing.php"></a>
                        </div>
                        
                        <div class="box1-pt2">
                            <div class="box1-pt2-hd">
                                <p style="word-break:break-all;">
                                昆凌晒周杰伦带女儿游泳背影照，父女俩海中举手比耶超有爱
                                </p>
                                <div class="line"></div>
                            </div>
                                <?php foreach($rows1 as $row1){?>
                                    <li><?=$row1["Title1"]?></li>

                                <?php } ?>                                    
                            </div> 
                        </div>
                    </div>
                    <div class="adc"></div>
                    <!--第二个盒子box分块-->
                    <div class="box2">
                        <div class="box-title">
                            XX新闻<p>LOCAL NEWS</p>
                        </div>

                        <div class="box-pt1">
                                <div class="box-hd"><span>热点新闻</span></div>
                                <?php foreach($rows2 as $row2){?>
                                    <li><?=$row2["Title2"]?></li>
                                <?php } ?>
                        </div>

                
                        <div class="box-pt2">
                            <div class="box-hd"><f>新闻图片</f></div>
                            <div class="box-pt2-hd">
                                <img src="xdh.jpeg" alt="百度图片">
                                <p>夏东海喝水接电话</p>
                            </div>
                        </div>
                        <div class="box-pt3">
                            <div class="box-hd"><span>新闻资讯</span></div>
                            <ul class="comlist">
                                <li>XXXXXXXXXXXXXXXXXX</li>
                                <li>XXXXXXXXXXXXXXXXXX</li>
                                <li>XXXXXXXXXXXXXXXXXX</li>
                                <li>XXXXXXXXXXXXXXXXXX</li>
                                <li>XXXXXXXXXXXXXXXXXX</li>
                                <li>XXXXXXXXXXXXXXXXXX</li>
                                <li>XXXXXXXXXXXXXXXXXX</li>
                                <li>XXXXXXXXXXXXXXXXXX</li>
                            </ul>
                        </div> 
                    </div>
                    
                    
                    <div id="recordInfo">
                        
                    </div>
                </div>
            </div>
            <div id="footer" class="footer">
                <div id="copyright" class="copyright">
                    <p>关于XXXX | 服务协议 | 隐私政策 | 开放平台 | 商务洽谈 | 客服中心 | 网站导航 | 客户端下载</p>
                </div>
            </div>
        </div>
        <!--悬浮导航-->
        <div class="flaotwin" id="flaotwin" style="display:block;">
            <a class="div1">用户<br>反馈</a>
            <a class="div2">返回<br>顶部</a>
        </div>
        <!-- ----------------------------------------------------->


    </body>
</html>